const TOKEN_KEY = 'sysinteg_token'

export function getToken() {
  return localStorage.getItem(TOKEN_KEY)
}

export function setToken(token: string) {
  localStorage.setItem(TOKEN_KEY, token)
}

export function clearToken() {
  localStorage.removeItem(TOKEN_KEY)
}

export function getUserInfo() {
  return JSON.parse(localStorage.getItem('userInfo') || '{}')
}

export function setUserInfo(userInfo: any) {
  localStorage.setItem('userInfo', JSON.stringify(userInfo))
}

export function clearUserInfo() {
  localStorage.removeItem('userInfo')
}
